####################################
# Italy 26000 - 26999 by Lothos
####################################
# Who he is invading flags
#	ITAInvadeGreece		= Prepare for the invasion of Greece
#	ITAInvadeRussia		= Not actual war prep but send exp forces to Germany if allied

# Behavior Flags
#	ITADefendItaly		= Homeland defense AI
#	ITABuildStandard	= Standard builds
#	ITABuildLand		= Build Heavy on Land units

# Air AI Flags
#	ITAAirAINaval		= Priority on Naval targets
#	ITAAirAIGround		= Priority on Ground targets

# Naval AI Flags
#	ITANavalStandard	= Protect the central part of the med
#	ITANavalEthiopia	= Support Ethiopia
#	ITANavalGreece		= Support Greece invasion
#	ITANavalWestMed		= Support Spanish Invasion of Western Med is secured
#	ITANavalEastMed		= Support Eastern med as it is secured
#	ITANavalAllMed		= All of the Med is secured

################
# Italy changes political stance in war
#############################################
event = {
	id = 26000
	random = no 
	country = ITA

	trigger = {
		ai = yes
		OR = {
			AND = {
				# Belgium
				control = { province = 45 data = GER }
				control = { province = 50 data = GER }
				control = { province = 51 data = GER }
				control = { province = 52 data = GER }
				control = { province = 65 data = GER }
				control = { province = 68 data = GER }
				control = { province = 69 data = GER }
				control = { province = 70 data = GER }
				random = 30
			}
			control = { province = 56 data = GER } # Paris
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/ITA_Neutrality.ai" }
	}
}
################
# Italy prepares for Greece invasion
#############################################
event = {
	id = 26001
	random = no 
	country = ITA
	persistent = yes

	trigger = {
		ai = yes
		exists = GRE
		atwar = no
		control = { province = 390 data = ITA }
		control = { province = 391 data = ITA }
		NOT = { alliance = { country = GER country = GRE } }
		NOT = { alliance = { country = ITA country = GRE } }
		NOT = { local_flag = ITADefendItaly }
		NOT = { local_flag = ITAInvadeGreece }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAInvadeGreece }
		command = { type = local_clrflag which = ITAInvadeRussia }
		command = { type = ai which = "switch/ITA_Greece_Buildup.ai" }
	}
}
################
# Italy invades Greece
#############################################
event = {
	id = 26002
	random = no 
	country = ITA

	trigger = {
		ai = yes
		local_flag = ITAInvadeGreece
		NOT = { local_flag = ITADefendItaly }
		OR = {
			NOT = { exists = GRE }
			AND = {
				NOT = { exists = YUG }
				control = { province = 390 data = ITA }
				control = { province = 391 data = ITA }
			}
			AND = {
				exists = GRE
				NOT = { war = { country = ITA country = GRE } }
				NOT = { alliance = { country = GER country = GRE } }
				NOT = { alliance = { country = ITA country = GRE } }
				random = 15
				NOT = { war = { country = ITA country = USA } }
				control = { province = 390 data = ITA }
				control = { province = 391 data = ITA }
				OR = {
					garrison = { country = ITA province = 390 type = land size = 4 area = no } # Tirana
					garrison = { country = ITA province = 391 type = land size = 4 area = no } # Vlore
				}
				OR = {
					month = 9 # October
					AND = {
						month = 0 # January
						NOT = { month = 1 } # Febuary
					}
				}
				NOT = { local_flag = ITADefendItaly }
				OR = {
					exists = VIC
					control = { province = 56 data = GER } # Paris
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = war which = GRE }
		command = { type = ai which = "switch/ITA_Greece_Attack.ai" }
		command = { type = sleepevent which = 26001 }
		command = { type = local_clrflag which = ITAInvadeGreece }
	}
}
################
# Italy atwar with Russia
#############################################
event = {
	id = 26004
	random = no 
	country = ITA
	persistent = yes

	trigger = {
		ai = yes
		alliance = { country = ITA country = GER }
		NOT = { local_flag = ITAInvadeRussia }
		NOT = { local_flag = ITADefendItaly }
		NOT = { local_flag = ITAInvadeGreece }
		OR = {
			war = { country = ITA country = SOV }
			war = { country = ITA country = USA }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 30 month = february year = 1948 }

	action_a = {
		command = { type = ai which = "switch/ITA_Russia.ai" }
		command = { type = local_setflag which = ITAInvadeRussia }
	}
}
################
# Italy reset garrison after Ethiopia war
#############################################
event = {
	id = 26005
	random = no 
	country = ITA

	trigger = {
		ai = yes
		NOT = { war = { country = ITA country = ETH } }
	}
	
	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/ITA_Reset_Garrison.ai" }
	}
}
	
################
# Italy defends the homeland
#############################################
event = {
	id = 26006
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = ITADefendItaly }
		OR = {
			AND = { # Means they attacked Italy
				lost_national = { country = ITA value = 2 }
				control = { province = 534 data = ITA } # Sardinia
			}
			AND = { # Means they attacked Italy
				lost_national = { country = ITA value = 10 }
				NOT = { control = { province = 534 data = ITA } }# Sardinia
			}
			AND = { # Means they are preparing to attack Italy
				# Libya
				NOT = { control = { province = 932 data = ITA } }
				NOT = { control = { province = 924 data = ITA } }
				NOT = { control = { province = 919 data = ITA } }
			}
			
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITADefendItaly }
		command = { type = local_clrflag which = ITAInvadeRussia }
		command = { type = ai which = "switch/ITA_Homeland.ai" }
	}
}
################
# Italy sends troops back out
#############################################
event = {
	id = 26007
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = ITADefendItaly
		NOT = {
			AND = { # Means they attacked Italy
				lost_national = { country = ITA value = 2 }
				control = { province = 534 data = ITA } # Sardinia
			}
			AND = { # Means they attacked Italy
				lost_national = { country = ITA value = 10 }
				NOT = { control = { province = 534 data = ITA } }# Sardinia
			}
			AND = { # Means they are preparing to attack Italy
				# Libya
				NOT = { control = { province = 932 data = ITA } }
				NOT = { control = { province = 924 data = ITA } }
				NOT = { control = { province = 919 data = ITA } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITADefendItaly }
		command = { type = ai which = "switch/ITA_Homeland_Normal.ai" }
	}
}
################
# Italy Air AI Naval portion
#############################################
event = {
	id = 26008
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITAAirAINaval }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be true to load the Naval Air AI
		OR = {
			AND = {
				war = { country = ENG country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = ENG province = 2439  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2437  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2438  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2441  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2440  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2442  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2443  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2448  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2446  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2445  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2444  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = FRA country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = FRA province = 2439  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2437  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2438  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2441  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2440  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2442  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2443  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2448  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2446  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2445  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2444  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = USA country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = USA province = 2439  type = naval size = 2 area = no }
					garrison = { country = USA province = 2437  type = naval size = 2 area = no }
					garrison = { country = USA province = 2438  type = naval size = 2 area = no }
					garrison = { country = USA province = 2441  type = naval size = 2 area = no }
					garrison = { country = USA province = 2440  type = naval size = 2 area = no }
					garrison = { country = USA province = 2442  type = naval size = 2 area = no }
					garrison = { country = USA province = 2443  type = naval size = 2 area = no }
					garrison = { country = USA province = 2448  type = naval size = 2 area = no }
					garrison = { country = USA province = 2446  type = naval size = 2 area = no }
					garrison = { country = USA province = 2445  type = naval size = 2 area = no }
					garrison = { country = USA province = 2444  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = SOV country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = SOV province = 2439  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2437  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2438  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2441  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2440  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2442  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2443  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2448  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2446  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2445  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2444  type = naval size = 2 area = no }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAAirAINaval }
		command = { type = local_clrflag which = ITAAirAIGround }
		command = { type = ai which = "switch/ITA_Air_Naval.ai" }
	}
}
################
# Italy Air AI Ground portion
#############################################
event = {
	id = 26009
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITAAirAIGround }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be true to load the GRound Air AI
		NOT = {
			AND = {
				war = { country = ENG country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = ENG province = 2439  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2437  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2438  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2441  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2440  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2442  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2443  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2448  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2446  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2445  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2444  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = FRA country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = FRA province = 2439  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2437  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2438  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2441  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2440  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2442  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2443  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2448  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2446  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2445  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2444  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = USA country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = USA province = 2439  type = naval size = 2 area = no }
					garrison = { country = USA province = 2437  type = naval size = 2 area = no }
					garrison = { country = USA province = 2438  type = naval size = 2 area = no }
					garrison = { country = USA province = 2441  type = naval size = 2 area = no }
					garrison = { country = USA province = 2440  type = naval size = 2 area = no }
					garrison = { country = USA province = 2442  type = naval size = 2 area = no }
					garrison = { country = USA province = 2443  type = naval size = 2 area = no }
					garrison = { country = USA province = 2448  type = naval size = 2 area = no }
					garrison = { country = USA province = 2446  type = naval size = 2 area = no }
					garrison = { country = USA province = 2445  type = naval size = 2 area = no }
					garrison = { country = USA province = 2444  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = SOV country = ITA }
				NOT = { lost_national = { country = ITA value = 2 } }
				OR = {
					# Central Med
					garrison = { country = SOV province = 2439  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2437  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2438  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2441  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2440  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2442  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2443  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2448  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2446  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2445  type = naval size = 2 area = no }
					garrison = { country = SOV province = 2444  type = naval size = 2 area = no }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITAAirAINaval }
		command = { type = local_setflag which = ITAAirAIGround }
		command = { type = ai which = "switch/ITA_Air_Ground.ai" }
	}
}
################
# Italy standard Naval AI
#############################################
event = {
	id = 26010
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			NOT = { local_flag = ITANavalStandard }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		NOT = { war = { country = GRE country = ITA } }
		NOT = { war = { country = TUR country = ITA } }
		NOT = {
			OR = {
				control = { province = 906 data = ITA } # Alexandria
				AND = {
					alliance = { country = GER country = ITA }
					control = { province = 906 data = GER } # Alexandria
				}
			}
			OR = {
				war = { country = SPR country = ITA }
				war = { country = SPA country = ITA }
				control = { province = 354 data = ITA } # Valencia
				AND = {
					alliance = { country = GER country = ITA }
					control = { province = 354 data = GER } # Valencia
				}
			}
			AND = {
				NOT = { war = { country = ENG country = ITA } }
				NOT = { war = { country = FRA country = ITA } }
				NOT = { war = { country = USA country = ITA } }
				NOT = { war = { country = SPR country = ITA } }
				NOT = { war = { country = SPA country = ITA } }
				OR = {
					war = { country = ETH country = ITA }
					AND = {
						year = 1936
						NOT = { year = 1937 }
						OR = {
							NOT = { exists = ETH }
							puppet = { country = ETH country = ITA }
						}
					}
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITANavalStandard }
		command = { type = local_clrflag which = ITANavalEthiopia }
		command = { type = local_clrflag which = ITANavalGreece }
		command = { type = local_clrflag which = ITANavalWestMed }
		command = { type = local_clrflag which = ITANavalEastMed }
		command = { type = local_clrflag which = ITANavalAllMed }
		command = { type = ai which = "switch/ITA_Naval_Standard.ai" }
	}
}
################
# Italy Ethiopia Naval AI
#############################################
event = {
	id = 26011
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITANavalEthiopia }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		NOT = { war = { country = ENG country = ITA } }
		NOT = { war = { country = FRA country = ITA } }
		NOT = { war = { country = USA country = ITA } }
		NOT = { war = { country = SPR country = ITA } }
		NOT = { war = { country = SPA country = ITA } }
		OR = {
			war = { country = ETH country = ITA }
			AND = {
				year = 1936
				NOT = { year = 1937 }
				OR = {
					NOT = { exists = ETH }
					puppet = { country = ETH country = ITA }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITANavalStandard }
		command = { type = local_setflag which = ITANavalEthiopia }
		command = { type = local_clrflag which = ITANavalGreece }
		command = { type = local_clrflag which = ITANavalWestMed }
		command = { type = local_clrflag which = ITANavalEastMed }
		command = { type = local_clrflag which = ITANavalAllMed }
		command = { type = ai which = "switch/ITA_Naval_Ethiopia.ai" }
	}
}
################
# Italy Greece Naval AI
#############################################
event = {
	id = 26012
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITANavalGreece }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		war = { country = GRE country = ITA }
		NOT = {
			OR = {
				control = { province = 906 data = ITA } # Alexandria
				AND = {
					alliance = { country = GER country = ITA }
					control = { province = 906 data = GER } # Alexandria
				}
			}
			OR = {
				war = { country = SPR country = ITA }
				war = { country = SPA country = ITA }
				control = { province = 354 data = ITA } # Valencia
				AND = {
					alliance = { country = GER country = ITA }
					control = { province = 354 data = GER } # Valencia
				}
			}
			AND = {
				NOT = { war = { country = ENG country = ITA } }
				NOT = { war = { country = FRA country = ITA } }
				NOT = { war = { country = USA country = ITA } }
				NOT = { war = { country = SPR country = ITA } }
				NOT = { war = { country = SPA country = ITA } }
				year = 1936
				NOT = { year = 1937 }
				OR = {
					NOT = { exists = ETH }
					puppet = { country = ETH country = ITA }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITANavalStandard }
		command = { type = local_clrflag which = ITANavalEthiopia }
		command = { type = local_setflag which = ITANavalGreece }
		command = { type = local_clrflag which = ITANavalWestMed }
		command = { type = local_clrflag which = ITANavalEastMed }
		command = { type = local_clrflag which = ITANavalAllMed }
		command = { type = ai which = "switch/ITA_Naval_Greece.ai" }
	}
}
################
# Italy Western Med Naval AI
#############################################
event = {
	id = 26013
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITANavalWestMed }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		NOT = { war = { country = GRE country = ITA } }
		OR = {
			war = { country = SPR country = ITA }
			war = { country = SPA country = ITA }
			control = { province = 354 data = ITA } # Valencia
			AND = {
				alliance = { country = GER country = ITA }
				control = { province = 354 data = GER } # Valencia
			}
		}
		NOT = {
			OR = {
				control = { province = 906 data = ITA } # Alexandria
				AND = {
					alliance = { country = GER country = ITA }
					control = { province = 906 data = GER } # Alexandria
				}
			}
			AND = {
				NOT = { war = { country = ENG country = ITA } }
				NOT = { war = { country = FRA country = ITA } }
				NOT = { war = { country = USA country = ITA } }
				NOT = { war = { country = SPR country = ITA } }
				NOT = { war = { country = SPA country = ITA } }
				year = 1936
				NOT = { year = 1937 }
				OR = {
					NOT = { exists = ETH }
					puppet = { country = ETH country = ITA }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITANavalStandard }
		command = { type = local_clrflag which = ITANavalEthiopia }
		command = { type = local_clrflag which = ITANavalGreece }
		command = { type = local_setflag which = ITANavalWestMed }
		command = { type = local_clrflag which = ITANavalEastMed }
		command = { type = local_clrflag which = ITANavalAllMed }
		command = { type = ai which = "switch/ITA_Naval_WestMed.ai" }
	}
}
################
# Italy Eastern Med Naval AI
#############################################
event = {
	id = 26014
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITANavalEastMed }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		NOT = { war = { country = GRE country = ITA } }
		OR = {
			control = { province = 906 data = ITA } # Alexandria
			AND = {
				alliance = { country = GER country = ITA }
				control = { province = 906 data = GER } # Alexandria
			}
		}
		NOT = {
			AND = {
				NOT = { war = { country = ENG country = ITA } }
				NOT = { war = { country = FRA country = ITA } }
				NOT = { war = { country = USA country = ITA } }
				NOT = { war = { country = SPR country = ITA } }
				NOT = { war = { country = SPA country = ITA } }
				year = 1936
				NOT = { year = 1937 }
				OR = {
					NOT = { exists = ETH }
					puppet = { country = ETH country = ITA }
				}
			}
			OR = {
				war = { country = SPR country = ITA }
				war = { country = SPA country = ITA }
				control = { province = 354 data = ITA } # Valencia
				AND = {
					alliance = { country = GER country = ITA }
					control = { province = 354 data = GER } # Valencia
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITANavalStandard }
		command = { type = local_clrflag which = ITANavalEthiopia }
		command = { type = local_clrflag which = ITANavalGreece }
		command = { type = local_clrflag which = ITANavalWestMed }
		command = { type = local_setflag which = ITANavalEastMed }
		command = { type = local_clrflag which = ITANavalAllMed }
		command = { type = ai which = "switch/ITA_Naval_EastMed.ai" }
	}
}
################
# Italy All of the Med Naval AI
#############################################
event = {
	id = 26015
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = ITANavalAllMed }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		NOT = { war = { country = GRE country = ITA } }
		OR = {
			control = { province = 906 data = ITA } # Alexandria
			AND = {
				alliance = { country = GER country = ITA }
				control = { province = 906 data = GER } # Alexandria
			}
		}
		OR = {
			war = { country = SPR country = ITA }
			war = { country = SPA country = ITA }
			control = { province = 354 data = ITA } # Valencia
			AND = {
				alliance = { country = GER country = ITA }
				control = { province = 354 data = GER } # Valencia
			}
		}
		NOT = {
			AND = {
				NOT = { war = { country = ENG country = ITA } }
				NOT = { war = { country = FRA country = ITA } }
				NOT = { war = { country = USA country = ITA } }
				NOT = { war = { country = SPR country = ITA } }
				NOT = { war = { country = SPA country = ITA } }
				year = 1936
				NOT = { year = 1937 }
				OR = {
					NOT = { exists = ETH }
					puppet = { country = ETH country = ITA }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITANavalStandard }
		command = { type = local_clrflag which = ITANavalEthiopia }
		command = { type = local_clrflag which = ITANavalGreece }
		command = { type = local_clrflag which = ITANavalWestMed }
		command = { type = local_clrflag which = ITANavalEastMed }
		command = { type = local_setflag which = ITANavalAllMed }
		command = { type = ai which = "switch/ITA_Naval_AllMed.ai" }
	}
}
################
# Italy Ethiopia Naval AI
#############################################
event = {
	id = 26016
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			war = { country = ENG country = ITA }
			war = { country = FRA country = ITA }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/ITA_atwar_ENG_FRA.ai" }
	}
}
################
# Italy Build AI
#	ITABuildStandard	= Standard builds
#	ITABuildLand		= Build Heavy on Land units
#############################################
event = {
	id = 26017
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = ITABuildLand }
		OR = {
			lost_national = { country = ITA value = 1 }
			war = { country = GER country = ITA }
			AND = {
				ai = ENG
				war = { country = ENG country = ITA }
				land_percentage = { country = ENG value = 0.5 }
			}
			AND = {
				NOT = { ai = ENG }
				war = { country = ENG country = ITA }
				land_percentage = { country = ENG value = 0.8 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/ITA_Build_Land.ai" }
		command = { type = local_setflag which = ITABuildLand }
		command = { type = local_clrflag which = ITABuildStandard }
	}
}
event = {
	id = 26018
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = ITABuildStandard }
		NOT = {
			lost_national = { country = ITA value = 1 }
			war = { country = GER country = ITA }
			AND = {
				ai = ENG
				war = { country = ENG country = ITA }
				land_percentage = { country = ENG value = 0.5 }
			}
			AND = {
				NOT = { ai = ENG }
				war = { country = ENG country = ITA }
				land_percentage = { country = ENG value = 0.8 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/ITA_Build_Standard.ai" }
		command = { type = local_clrflag which = ITABuildLand }
		command = { type = local_setflag which = ITABuildStandard }
	}
}
#########################################################################
#  Italy builds paratroopers
#########################################################################
event = {
	id = 26019
	random = no
	country = ITA
	persistent = yes
	style = 0	

	trigger = {
		ai = yes
		technology = 1070 # Airborne
		transport_plane = { country = ITA value = 1 }
		NOT = { paratrooper = { country = ITA value = 1 } }
		NOT = { lost_national = { country = ITA value = 2 } }
	}


	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	name = "AI_EVENT"

	action_a = {
		command = { type = build_division which = paratrooper }
	}
}







####################################
# Italy 26500 - 26599 = Minister Change Events
####################################
################
# Minister of Security Section 26500 - 26509
#############################################
################
# Chief of Staff Section 26510 - 26519
#############################################
event = { # Francesco Grazioli takes power
	id = 26510
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		minister = 3007 # Francesco Grazioli
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAChiefFrancesco }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAChiefFrancesco }
		command = { type = local_clrflag which = ITAChiefCingolani }
		command = { type = chiefofstaff which = 3007 }
		command = { type = dissent value = -1 }
	}
}
event = { # Mario Cingolani takes power
	id = 26511
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		minister = 3130 # Mario Cingolani
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAChiefCingolani }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITAChiefFrancesco }
		command = { type = local_setflag which = ITAChiefCingolani }
		command = { type = chiefofstaff which = 3130 }
		command = { type = dissent value = -1 }
	}
}
################
# Head of Intelligence Section 26520 - 26529
#############################################
event = { # Umberto Ricci takes power
	id = 26520
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 3016 # Umberto Ricci
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAIntelligenceUmberto }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAIntelligenceUmberto }
		command = { type = local_clrflag which = ITAIntelligenceDino }
		command = { type = ministerofintelligence which = 3016 }
		command = { type = dissent value = -1 }
	}
}
event = { # Dino Grandi takes power
	id = 26521
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		NOT = { minister = 3016 } # Umberto Ricci
		minister = 3109 # Dino Grandi
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAIntelligenceDino }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITAIntelligenceUmberto }
		command = { type = local_setflag which = ITAIntelligenceDino }
		command = { type = chiefofstaff which = 3109 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of the Army Section 26530 - 26539
#############################################
event = { # Rodolfo Graziani takes power
	id = 26530
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		minister = 3139 # Rodolfo Graziani
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAArmyGraziani }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAArmyGraziani }
		command = { type = local_clrflag which = ITAArmyPariani }
		command = { type = chiefofarmy which = 3139 }
		command = { type = dissent value = -1 }
	}
}
event = { # Alberto Pariani takes power
	id = 26531
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		minister = 3008 # Alberto Pariani
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAArmyPariani }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITAArmyGraziani }
		command = { type = local_setflag which = ITAArmyPariani }
		command = { type = chiefofarmy which = 3008 }
		command = { type = dissent value = -1 }
	}
}
################
# Armament Minister Section 26540 - 26549
#############################################
event = { # Ubaldo Soddu takes power
	id = 26540
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 3066 # Ubaldo Soddu
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAArmamentUbaldo }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAArmamentUbaldo }
		command = { type = local_clrflag which = ITAArmamentBenito }
		command = { type = armamentminister which = 3066 }
		command = { type = dissent value = -1 }
	}
}
event = { # Benito Mussolini takes power
	id = 26541
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 3004 # Benito Mussolini
		NOT = { minister = 3066 } # Benito Mussolini
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAArmamentBenito }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAArmamentBenito }
		command = { type = local_clrflag which = ITAArmamentUbaldo }
		command = { type = armamentminister which = 3004 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Air Minister Section 22550 - 22559
# Air AI Flags
#	ITAAirAINaval		= Priority on Naval targets
#	ITAAirAIGround		= Priority on Ground targets
#############################################
event = { # Francesco Pricolo takes power
	id = 26550
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = ITAAirAINaval
		minister = 3160 # Francesco Pricolo
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAChiefAirFrancesco }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAChiefAirFrancesco }
		command = { type = local_clrflag which = ITAChiefAirGiuseppe }
		command = { type = local_clrflag which = ITAChiefAirRino }
		command = { type = chiefofair which = 3160 }
		command = { type = dissent value = -1 }
	}
}
event = { # Rino Corso Fougier takes power
	id = 26551
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = ITAAirAIGround
		minister = 3161 # Rino Corso Fougier
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAChiefAirRino }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ITAChiefAirRino }
		command = { type = local_clrflag which = ITAChiefAirFrancesco }
		command = { type = local_clrflag which = ITAChiefAirGiuseppe }
		command = { type = chiefofair which = 3161 }
		command = { type = dissent value = -1 }
	}
}
event = { # Giuseppe Valle takes power
	id = 26552
	random = no 
	country = ITA
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = ITAAirAIGround
		NOT = { minister = 3161 } # Rino Corso Fougier
		minister = 3010 # Giuseppe Valle
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = ITAChiefAirGiuseppe }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ITAChiefAirFrancesco }
		command = { type = local_setflag which = ITAChiefAirGiuseppe }
		command = { type = local_clrflag which = ITAChiefAirRino }
		command = { type = chiefofair which = 3010 }
		command = { type = dissent value = -1 }
	}
}